<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="author" content="lizhongwen@lizhongwen.com">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../css/public.css" media="all">
    <!--
    * [LupMisNotAllowedSync]
    * 本代码为系统自动生成代码，请根据自己业务进行修改;
    * 生成时间 2022-02-15 18:29:17;
    * 版权所有 2020-2022 lizhongwen，并保留所有权利;
    * 说明: 这不是一个自由软件！您只能在不用于商业目的的前提下对程序代码进行修改和使用；不允许对程序代码以任何形式任何目的的再发布;
    * 作者: 中文Lee;
    * 作者主页: http://www.lizhongwen.com;
    * 邮箱: 360811363@qq.com;
    * QQ: 360811363;
    -->
</head>

<body style="background: #fff;padding: 0;margin: 0;">
    <div class="layui-card" style="padding: 0;margin: 0;">
        <div class="layui-card-body">
            <div class="layui-upload-drag layui-col-lg12" id="uploadFile" style="width: 100%">
                <i class="layui-icon"></i>
                <p>点击上传，或将文件拖拽到此处</p>
            </div>
        </div>
    </div>
    <script src="../js/run.js"></script>
    <script>
        $init(function() {
            var name = getQueryString("name") || "";
            var exts = getQueryString("exts") || false;
            var path = getQueryString("path") || "";
            var fieldName = getQueryString("field_name") || "";
            var thumb = getQueryString("thumb") || "";
            var remarks = getQueryString("remarks") || "后台上传";
            var index = parent.layer.getFrameIndex(window.name);
            var url = base_gateway + 'sys/upload/uploadFile';
            layui.upload.render({
                elem: '#uploadFile',
                url: url,
                field: "file",
                size: 0,
                headers: {
                    accessuid: localStorage.getItem("accessuid"),
                    accesstoken: localStorage.getItem("accesstoken")
                },
                data: {
                    thumb: thumb,
                    path: path,
                    remarks: remarks
                },
                accept: 'file',
                exts: exts,
                choose: function(obj) {
                    var loading = layer.load(2, {
                        shade: 0.2
                    });
                },
                done: function(ret) {
                    layer.closeAll('loading');

                    if (ret.code == 200) {
                        window.parent.uploadSuccess(name, ret, fieldName);
                        if (typeof(window.parent.uploadAttatch) != "undefined") {
                            window.parent.uploadAttatch(ret);
                        }
                        layer.closeAll('loading');
                        layer.load(2);
                        layer.msg(ret.msg, {
                            icon: 6
                        });
                        setTimeout(function() {
                            parent.layer.close(index);
                        }, 1500);
                    } else {
                        layer.msg(ret.msg, {
                            icon: 5
                        });
                    }
                }
            });
        });
    </script>
</body>

</html>